package org.jprogger.myworld.api.service;

import java.util.HashMap;
import java.util.Map;

import org.jprogger.myworld.api.ApiServiceInvocationException;
import org.jprogger.myworld.api.app.AppContext;
import org.jprogger.myworld.api.response.ApiResponse;
import org.jprogger.myworld.api.response.handler.OpenPaymentDialogApiResponseHandler;

public class PaymentService extends BaseApiService {

	public PaymentService(AppContext context) {
		super(context);
	}
	
	public ApiResponse<Boolean> openPaymentDialog(String windowId, int serviceId, String serviceName, 
			int smsPrise, int otherPrise) throws ApiServiceInvocationException {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("window_id", windowId);
		params.put("service_id", serviceId);
		params.put("service_name", serviceName);
		params.put("sms_prise", smsPrise);
		params.put("other_prise", otherPrise);
		params.put("method", "payments.openDialog");
		return apiCall(params, new OpenPaymentDialogApiResponseHandler());
	}
}
